import request from '@/utils/request'
import requestFlow from '@/utils/requestFlow'
export function test(data) {
  return requestFlow({
    url: '/api/flow/processInstance/authUserList',
    method: 'post',
    data
  })
}

export function pageRequest(data) {
  return request({
    url: '/api/system/role/page',
    method: 'post',
    data
  })
}

export function delRequest(id) {
  return request({
    url: '/api/system/role/delete/' + id,
    method: 'get'
  })
}

export function detailRequest(id) {
  return request({
    url: '/api/system/role/detail',
    method: 'get',
    params: { id }
  })
}

export function addRequest(data) {
  return request({
    url: '/api/system/role/add',
    method: 'post',
    data
  })
}
// 授权菜单
export function listWithTree(data) {
  return request({
    url: '/api/system/menus/listWithTree',
    method: 'post',
    data
  })
}

export function getRoleHaveMenus(id) {
  return request({
    url: '/api/system/role/getRoleHaveMenus/' + id,
    method: 'get'
  })
}

export function addRoleMenus(data) {
  return request({
    url: '/api/system/role/addRoleMenus',
    method: 'post',
    data
  })
}

